package com.example.demo.controller;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.custom.AjaxResult;
import com.example.demo.entity.SysUser;
import com.example.demo.service.AfterSaleFrontWeiXiuComputerService;
import com.example.demo.service.SaleComputerService;
import com.example.demo.service.SysUserService;

@RestController
@RequestMapping(value = "/test")
public class TestController {
	@Autowired
	private AfterSaleFrontWeiXiuComputerService afterService;
	@Autowired
	private SysUserService userService;
	@Autowired
	private SaleComputerService salecumService;
	
	
	DateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	@RequestMapping(value = "/aaa")
	public Object aaa() {
		SysUser user=userService.findById(1);
		Date beginDate = null;
		try {
			beginDate = dateFormat1.parse("2021-04-22 00:00:00");
	
			System.out.println(beginDate);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Date endDate = null;
		try {
			endDate = dateFormat1.parse("2021-04-30 18:09:13");
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	return new AjaxResult(salecumService.newCarQuYuWaiNums(user, beginDate, endDate));
	
	}
}
